package com.freemyleft.left.left_app.mian.index.my;

import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.freemyleft.left.left_app.R;
import com.freemyleft.left.left_app.R2;
import com.freemyleft.left.left_app.mian.index.my.accept_setup.address_managerment.AddressManagementDelegate;
import com.freemyleft.left.zapp.delegates.LeftDelegate;
import com.freemyleft.left.zapp.util.callback.CallbackManager;
import com.freemyleft.left.zapp.util.callback.CallbackType;
import com.freemyleft.left.zapp.util.callback.IGlobalCallback;

import butterknife.BindView;
import butterknife.OnClick;
import de.hdodenhof.circleimageview.CircleImageView;

public class UserMessageDelegate extends LeftDelegate {
    @BindView(R2.id.image_photo)
    CircleImageView circleImageView;

    @OnClick(R2.id.address_management)
    void addree() {
        start(new AddressManagementDelegate());
    }

    @OnClick(R2.id.image_photo)
    void onClickPhoto() {
        startCameraWithCheck();
        CallbackManager.getInstance().addCallback(CallbackType.ON_CROP, new IGlobalCallback<Uri>() {
            @Override
            public void executeCallback(@Nullable Uri args) {
                Glide.with(getContext())
                        .load(args.getPath()).into(circleImageView);
            }
        });

    }


    @Override
    public Object setLayout() {
        return R.layout.delegate_user_message;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {

    }
}
